import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path' //导入 node.js path


// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  //配置路径别名
      server: {
      proxy: {
        '/api': {
          target: 'http://localhost:8000',
          changeOrigin: true,
          rewrite: (path) => path.replace(/^\/api/, '')
        }
      }
    },
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src')
    }
  }
})